import React, { Component, PropTypes } from 'react';
import className from 'classnames';
import './Result.scss';

class Result extends Component {
    render() {
        const {type, title, content, icon} = this.props;
        const cls = className('result',{
            [type]: !!type
        })
        return (
            <section className={cls}>
                <div className="result-info">
                    <div className="result-icon">{icon}</div>
                    <p className="result-tips">{title}</p>
                </div>
                {content && <div className="result-content">{content}</div>}
            </section>
        );
    }
}

Result.propTypes = {
    type: PropTypes.string,
}


export default Result;